package com.onlymarshall.wheresmao.dao.jdo;

import javax.jdo.PersistenceManagerFactory;

import com.onlymarshall.wheresmao.dao.Dao;
import com.onlymarshall.wheresmao.dao.PMF;

public abstract class BaseDaoJdo<T> implements Dao<T>{
	protected PersistenceManagerFactory pmf = PMF.get();

	public PersistenceManagerFactory getPmf() {
		return pmf;
	}

	public void setPmf(PersistenceManagerFactory pmf) {
		this.pmf = pmf;
	}

	@Override
	public void delete(T t) {
		pmf.getPersistenceManager().deletePersistent(t);
	}

	@Override
	public T save(T t) {
		return pmf.getPersistenceManager().makePersistent(t);
	}
	
	
}
